package com.demo.eshop.pdetail;


import com.demo.eshop.pdetail.listener.InitListner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
@MapperScan("com.demo.eshop.pdetail.mapper")
public class EshopPdetailApplication {

    @Bean
    public ServletListenerRegistrationBean servletListenerRegistrationBean (){
        ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
        servletListenerRegistrationBean.setListener(new InitListner());
        return servletListenerRegistrationBean;
    };


    public static void main(String[] args) {
        SpringApplication.run(EshopPdetailApplication.class, args);
    }
}
